import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import matplotlib.image as img
import os

mpl.rcParams['ytick.color']='white'
mpl.rcParams['xtick.color']='white'
mpl.rcParams['ytick.labelsize']='large'
mpl.rcParams['xtick.labelsize']='large'
mpl.rcParams['axes.edgecolor']='white'

fn=os.path.dirname(os.path.realpath(__file__))+'/picture.png'
bgimg = img.imread(fn)

x = np.arange(0.0, 2*np.pi, np.pi/100)
y = np.sin(x)

def plotax(ax):
    ax.set_facecolor('None')
    ax.plot(x, y,'w')
        
fig = plt.figure(1)
fig.figimage(bgimg)
ax = fig.add_subplot(131)
plotax(ax)
ax.tick_params(axis='x',width=2,colors='gold')
ax.set_title("axis='x'",color='w')
ax = fig.add_subplot(132)
plotax(ax)
ax.tick_params(axis='y',width=2,colors='gold')
ax.set_title("axis='y'",color='w')
ax = fig.add_subplot(133)
plotax(ax)
ax.tick_params(axis='both',width=2,colors='gold')
ax.set_title("axis='both'",color='w')

fig = plt.figure(2)
fig.figimage(bgimg)
ax = fig.add_subplot(131)
plotax(ax)
ax.tick_params(which='major',width=2,colors='gold')
ax.set_title("which='major'",color='w')
ax = fig.add_subplot(132)
plotax(ax)
ax.tick_params(which='minor',width=2,colors='gold')
ax.set_title("which='minor'",color='w')
ax = fig.add_subplot(133)
plotax(ax)
ax.tick_params(which='both',width=2,colors='gold')
ax.set_title("which='both'",color='w')

fig = plt.figure(3)
fig.figimage(bgimg)
ax = fig.add_subplot(131)
plotax(ax)
ax.tick_params(direction='in',width=2,length=4,colors='gold')
ax.set_title("direction='in'",color='w')
ax = fig.add_subplot(132)
plotax(ax)
ax.tick_params(direction='out',width=2,length=4,colors='gold')
ax.set_title("direction='out'",color='w')
ax = fig.add_subplot(133)
plotax(ax)
ax.tick_params(direction='inout',width=2,length=4,colors='gold')
ax.set_title("direction='inout'",color='w')

fig = plt.figure(4)
fig.figimage(bgimg)
ax = fig.add_subplot(131)
plotax(ax)
ax.set_title("default",color='w')
ax = fig.add_subplot(133)
plotax(ax)
ax.tick_params(width=4,colors='gold')
ax.set_title("width=4",color='w')
ax = fig.add_subplot(132)
plotax(ax)
ax.tick_params(length=10,colors='gold')
ax.set_title("length=10",color='w')

fig = plt.figure(5)
fig.figimage(bgimg)
ax = fig.add_subplot(131)
plotax(ax)
ax.set_title("default",color='w')
ax = fig.add_subplot(132)
plotax(ax)
ax.tick_params(pad=1,colors='gold')
ax.set_title("pad=1",color='w')
ax = fig.add_subplot(133)
plotax(ax)
ax.tick_params(pad=10,colors='gold')
ax.set_title("pad=10",color='w')

fig = plt.figure(6)
fig.figimage(bgimg)
ax = fig.add_subplot(131)
plotax(ax)
ax.tick_params(width=4,color='gold')
ax.set_title("color='gold'",color='w')
ax = fig.add_subplot(132)
plotax(ax)
ax.tick_params(width=4,labelcolor='gold')
ax.set_title("labelcolor='gold'",color='w')
ax = fig.add_subplot(133)
plotax(ax)
ax.tick_params(width=4,colors='gold')
ax.set_title("colors='gold'",color='w')

fig = plt.figure(7)
fig.figimage(bgimg)
ax = fig.add_subplot(131)
plotax(ax)
ax.tick_params(labelsize='medium')
ax.set_title("default",color='w')
ax = fig.add_subplot(132)
plotax(ax)
ax.tick_params(labelsize='large')
ax.set_title("labelsize='large'",color='w')
ax = fig.add_subplot(133)
plotax(ax)
ax.tick_params(labelsize=15)
ax.set_title("labelsize=15",color='w')

fig = plt.figure(8)
fig.figimage(bgimg)
ax = fig.add_subplot(131)
plotax(ax)
ax.tick_params(bottom=False,top=True,width=4,colors='gold')
ax.set_title("bottom=False,top=True",color='w')
ax = fig.add_subplot(132)
plotax(ax)
ax.tick_params(left=False,right=True,width=4,colors='gold')
ax.set_title("left=False,right=True",color='w')
ax = fig.add_subplot(133)
plotax(ax)
ax.tick_params(top=True,right=True,width=4,colors='gold')
ax.set_title("top=True,right=True",color='w')

fig = plt.figure(9)
fig.figimage(bgimg)
ax = fig.add_subplot(131)
plotax(ax)
ax.tick_params(labelbottom=False,labeltop=True,width=4,colors='gold')
ax = fig.add_subplot(133)
plotax(ax)
ax.tick_params(labelleft=False,labelright=True,width=4,colors='gold')
ax = fig.add_subplot(132)
plotax(ax)
ax.tick_params(labeltop=True,labelright=True,width=4,colors='gold')

plt.show()
